<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<html>
<head>
<th:block th:include="include :: header('送审')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <div class="row">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="false">审核</a>
                        </li>
                        <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">记录</a>
                        </li>
                        <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="true"> 内容</a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div id="tab-1" class="tab-pane active">
                            <div class="panel-body">
                                <form class="form-horizontal m" id="form-examine-examine">
                                    <input type="hidden" name="taskId" th:value="${taskId}">
                                    <div class="form-group" >  
                                    
                                        <div>  
                                            <label class="col-sm-2 control-label">审核：</label>
                                            <div class="col-sm-4">
                                                 <select id="examine" name="examine" class="form-control m-b">
                                                    <option value="yes">同意</option>
                                                    <option value="no">驳回</option>
                                                 </select>
                                            </div>
                                        </div>
                                        
                                        <div>  
                                            <label class="col-sm-2 control-label">下一步骤：</label>
                                            <div class="col-sm-4">
                                                 <select id="nextStep" name="nextStep" class="form-control m-b">
                                                    <option   th:each="node:${nodes}" th:value="${node}"  th:text="${node}" ></option>
                                                 </select>
                                            </div>
                                        </div>
                                        
                                        <div>
                                            <label class="col-sm-2 control-label">审核人员：</label>
                                            <div class="col-sm-4">
                                                <select id="assignee" name="assignee" class="form-control m-b">
                                                     <option   th:each="assignee:${assignees}" th:value="${assignee.id}"  th:text="${assignee.name}" ></option>
                                                </select>
                                            </div>
                                        </div>
                                        
                                    </div>
                                    <div class="form-group" >
                                        <label class="col-sm-2 control-label">备注：</label>
                                        <div class="col-sm-10">
                                            <textarea name="opinion" class="form-control" rows="4" ></textarea>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <div id="tab-2" class="tab-pane">
							<div class="panel-body"> 
				                 <div id="vertical-timeline" class="vertical-container dark-timeline" th:each="historyTask : ${historyTasks}">
				                     <div class="vertical-timeline-block">
				                         <div class="vertical-timeline-icon blue-bg">
				                             <i class="fa fa-file-text"></i>
				                         </div>
				                         <div class="vertical-timeline-content">
				                             <h2>[[${historyTask.assignee}]]:[[${historyTask.taskName}]]</h2>
				                             <h5>[[${@dict.getLabel('uflo_task_state', historyTask.state)}]]</h5>
				                             <p>[[${historyTask.opinion}]]</p>
				                             <span class="vertical-date">
				                         		<small>[[${#dates.format(historyTask.createDate,'yyyy/MM/dd HH:mm:ss')}]]  ~  [[${#dates.format(historyTask.endDate,'yyyy/MM/dd HH:mm:ss')}]]</small>
				                         		<small></small>
				                     		</span>
				                         </div>
				                     </div>
			              		</div>
							</div>
						</div>		     
                        
                        <div id="tab-3" class="tab-pane">
                            <div class="panel-body">
                               
                               <div th:include="asset/house/detail :: house_detail"></div>
                               
                            </div>
                        </div>
                    </div>
                </div>
            </div>
       </div> 
    </div>
	<th:block th:include="include :: footer" />
	
	<script th:src="@{/project/uflo/examine.js}"></script>
	
	<script th:inline="javascript">
	
	var prefix = ctx + "ufloTask";

	//流程key
	var key = [[${key}]];
	//步骤id
	var taskId = [[${taskId}]];	
	//下一步骤节点
	var nodes = [[${nodes}]];
	//下一步骤处理人
	var assignees = [[${assignees}]];
	//可回退节点
	var jumpNodes = [[${jumpNodes}]];
	
	
	var $form = $("#form-examine-examine");
	
	$form.validate({
       focusCleanup: true
   	});
	
	function submitHandler() {
		 if ($.validate.form()) {
             $.operate.save(prefix + "/examine", $form.serialize());
         }
      }
	
    </script>
	
</body>
</html>